ποΈGitΠ―ΡΠ°ποΈ
.github/copilot-instructions.md 321b73e7266bc4c970fcb9a5570dae90be247025 (321b73e7) Text, 5.87 KB
Meshtastic Android β Copilot Instructions
β Full rules: T383838AGENTS.md is the source of truth. This file is a compact quick-reference for build
β commands and task naming. For architecture, conventions, and workflow details, consult T383838AGENTS.md
β and the T383838.skills/ playbooks.
Build, Test & Lint
Requires: JDK 21, T383838ANDROID_HOME set, proto submodule initialized.
T282828
T8b949e# Bootstrap (run once per fresh clone)
git submodule update --init
Tff7b72[ -f local.properties Tff7b72] Tff7b72|| cp secrets.defaults.properties local.properties
T8b949e# Full local verification (formatting β lint β compile β tests)
./gradlew spotlessApply detekt assembleDebug Tffa657test allTests
T8b949e# Single module tests (KMP module)
./gradlew :core:data:allTests
T8b949e# Single module tests (Android-only module like :app)
./gradlew :androidApp:testFdroidDebugUnitTest
T8b949e# Cross-platform compilation check (no tests)
./gradlew kmpSmokeCompile
T8b949e# Flavor-specific lint
./gradlew lintFdroidDebug lintGoogleDebug
β Both T383838test AND T383838allTests are needed. T383838allTests covers KMP modules; T383838test covers pure-Android modules.
β Neither alone catches everything.
Gradle task naming (KMP vs Android-only)
KMP modules have different task names than pure-Android modules. Using the wrong name silently skips tests or fails resolution.
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββ
β Intent β KMP modules (`BT383838`Fdddcore:*`f`b, `BT383838`Fdddfeature:*`f`b) β Android-only (`BT383838`Fdddapp`f`b, `BT383838`Fdddcore:api`f`b, `BT383838`Fdddcore:barcode`f`b) β
βββββββββββββββββΌββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββ€
β Run tests β T383838:module:allTests β T383838:module:testFdroidDebugUnitTest β
β Detekt β T383838:module:detekt (lifecycle task) β T383838:module:detekt β
β Compile check β T383838:module:compileKotlinJvm β T383838:module:compileFdroidDebugKotlin β
βββββββββββββββββ΄ββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββ
Common mistakes:
β’ β T383838:core:network:detektMain β does not exist in KMP; variants are T383838detektJvmMain, T383838detektMetadataCommonMain, etc. Use T383838:core:network:detekt instead.
β’ β T383838:feature:connections:testDebugUnitTest β ambiguous in KMP modules. Use T383838:feature:connections:allTests.
β’ β T383838:feature:connections:compileFdroidDebugKotlin β wrong for KMP. Use T383838:feature:connections:compileKotlinJvm or T383838kmpSmokeCompile.
Quick Reference
β’ Architecture: KMP project (Android, Desktop, iOS). Business logic in T383838commonMain; platform shells (T383838androidApp/, T383838desktopApp/) wire DI and host UI.
β’ Flavors: T383838fdroid (OSS) / T383838google (Maps + DataDog). Only one installable at a time (different signing keys).
β See T383838AGENTS.md for full rules (verify before push, branch naming, protos, coding conventions).
β Contextual T383838.github/instructions/ files enforce conventions scoped to relevant source sets.
Agent Behavior Rules
Code quality β do it right the first time
When refactoring or improving code, implement the correct solution fully. Do not defer improvements as "too large", "out of scope", or "a separate refactoring". Research proper APIs and patterns before implementing β take the correct approach, not the simple one.
Git hygiene β preserve commit history
Always make new commits. Never T383838--amend, T383838rebase -i, squash, or T383838--force-with-lease unless the user explicitly requests it. Commit history is rollback safety β destroying it without permission is unacceptable.
Workflow scope push limitation
The Copilot CLI OAuth token cannot push changes to T383838.github/workflows/ files (requires T383838workflow scope). If a push fails with a permission/scope error on workflow files, immediately tell the user to push manually (T383838gh auth refresh -s workflow && git push). Do not retry or attempt workarounds.
Parallel agents β no destructive git operations
When dispatching parallel agents on a shared worktree, agents must never run T383838git reset --hard, T383838git clean, or T383838git checkout -- .. Commit work immediately before running any git operations that could affect the index or working tree.
Audit before applying
When porting, migrating, or applying external code/patterns, audit each change for relevance and correctness in our context. Do not blindly copy β evaluate whether each piece is appropriate and worth keeping.
Context & Cost Efficiency
Compact before research phases
When a session shifts from implementation to open-ended research or exploration (e.g., "do deep research onβ¦", "check documentation forβ¦"), proactively compact the session first. Research generates high-volume tool output that inflates context rapidly.
Split sessions at phase boundaries
Do not keep a single session alive across multiple discrete deliverables. When a phase completes (PR opened, spec finalized, implementation merged), suggest starting a fresh session for the next phase. A compact summary in the new session's first message is far cheaper than carrying forward accumulated checkpoint history.
Avoid redundant skill-context re-injection
If a skill's context has already been injected in the current session, do not re-inject the full payload on subsequent invocations. Reference the earlier context instead. If compaction occurred since the last injection, a brief summary is sufficient β not the full skill document again.
Agent-merge check-ins belong in their own session
PR lifecycle check-ins (merge condition checks, CI status polling) should run in a dedicated short-lived session, not in the development session. They only need PR metadata and CI status β not the accumulated dev context.
Compact by turn 12 in exploratory sessions
Any session that passes ~10-12 turns without compaction should be compacted. Context cost grows with every turn β later turns pay for the full accumulated history of all prior turns. Don't let sessions run 15+ turns uncompacted.
<!-- SPECKIT START -->
For additional context about technologies to be used, project structure,
shell commands, and other important information, read the current plan
<!-- SPECKIT END -->
Served by rngit 1.5.2 - Generated in 0.28s